package com.superitem.school.controller;

import com.superitem.school.config.JdbcConfig;
import com.superitem.school.pojo.Student;
import com.superitem.school.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.sql.DataSource;
import java.util.List;

//@RestController//返回字符串
@Controller//返回字符串
@RequestMapping("/H")
public class HelloController {


    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }

    @GetMapping("/data")
    public String showDataSourceConfig() {
        DataSource dataSource = new JdbcConfig().getDataSource();
        System.out.println(dataSource);
        return "dataSource : " + dataSource;
    }
}
